from typing import *


class Solution:
    def occurrencesOfElement(
        self, nums: List[int], queries: List[int], x: int
    ) -> List[int]:
        h = []
        for i, v in enumerate(nums):
            if v == x:
                h.append(i)
        ans = []
        for v in queries:
            if v > len(h):
                ans.append(-1)
            else:
                ans.append(h[v - 1])
        return ans
